home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / em-xmkit.zip / EMM19_A.ASM < prev    next >
Assembly Source File  |  1989-11-29  |  5KB  |  102 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM19_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_handle_attrib                                       ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns the attribute associated with a   ;
  7. ;                     handle.  The attributes are volatile or non-volatile.   ;
  8. ;                                                                             ;
  9. ;                     If the handle's attribute has been set to non-volatile, ;
  10. ;                     the handle, its name (if it is assigned one), and the   ;
  11. ;                     contents of the pages allocated to the handle are all   ;
  12. ;                     maintained after a warm boot.  However, this function   ;
  13. ;                     may be disabled with a user option or may not be        ;
  14. ;                     supported by the memory board or system hardware.       ;
  15. ;                                                                             ;
  16. ;                     A volatile handle attribute instructs the memory        ;
  17. ;                     manager to deallocate both the handle and the pages     ;
  18. ;                     allocated to it after a warm boot.  If all handles      ;
  19. ;                     have the volatile attribute (the default attribute)     ;
  20. ;                     at warm boot, the handle directory will be empty and    ;
  21. ;                     all of expanded memory will be initialized to zero      ;
  22. ;                     immediately after a warm boot.                          ;
  23. ;                                                                             ;
  24. ;           PASSED:   &attrib:                                                ;
  25. ;                        is a far pointer to the open EMM handle's attribute. ;
  26. ;                                                                             ;
  27. ;                     handle:                                                 ;
  28. ;                        is an open EMM handle.                               ;
  29. ;                                                                             ;
  30. ;         RETURNED:   status:                                                 ;
  31. ;                        is the status EMM returns from the call.  All other  ;
  32. ;                        returned results are valid only if the status        ;
  33. ;                        returned is zero.  Otherwise they are undefined.     ;
  34. ;                                                                             ;
  35. ;                     attrib:                                                 ;
  36. ;                        is an open EMM handle's attribute.  The only         ;
  37. ;                        attributes a handle may have are volatile or         ;
  38. ;                        non-volatile.  A value of zero indicates the handle  ;
  39. ;                        is volatile.  A value of one indicates that the      ;
  40. ;                        handle is non-volatile.                              ;
  41. ;                                                                             ;
  42. ; C USE CONVENTION:   unsigned int status;                                    ;
  43. ;                     unsigned int attrib;                                    ;
  44. ;                     unsigned int handle;                                    ;
  45. ;                                                                             ;
  46. ;                     status = get_handle_attrib (&attrib,                    ;
  47. ;                                                 handle);                    ;
  48. ;-----------------------------------------------------------------------------;
  49. .XLIST
  50. PAGE    60,132
  51.  
  52. IFDEF SMALL
  53.    .MODEL SMALL, C
  54. ENDIF
  55. IFDEF MEDIUM
  56.    .MODEL MEDIUM, C
  57. ENDIF
  58. IFDEF LARGE
  59.    .MODEL LARGE, C
  60. ENDIF
  61. IFDEF COMPACT
  62.    .MODEL COMPACT, C
  63. ENDIF
  64. IFDEF HUGE
  65.    .MODEL HUGE, C
  66. ENDIF
  67.  
  68. INCLUDE emmlib.equ
  69. INCLUDE emmlib.str
  70. INCLUDE emmlib.mac
  71. .LIST
  72. .CODE
  73.  
  74. get_handle_attrib    PROC                                                  \
  75.             ptr_attrib:FAR PTR WORD,                                  \
  76.             handle:WORD
  77.  
  78.     ;---------------------------------------------------------------------;
  79.     ;   do;                                                               ;
  80.     ;   .   get the current attribute of the specified handle;            ;
  81.     ;---------------------------------------------------------------------;
  82.     MOVE        AX, get_handle_attrib_fcn
  83.     MOVE        DX, handle
  84.     INT         EMM_int
  85.  
  86.     ;---------------------------------------------------------------------;
  87.     ;   .   pass the current handle attribute back to the caller;         ;
  88.     ;---------------------------------------------------------------------;
  89.     MOVE        DH:DL, 0:AL
  90.     MOVE        ES:BX, ptr_attrib
  91.     MOVE        ES:[BX], DX
  92.  
  93.     ;---------------------------------------------------------------------;
  94.     ;   .   return (EMM status);                                          ;
  95.     ;   end;                                                              ;
  96.     ;---------------------------------------------------------------------;
  97.     RET_EMM_STAT    AH
  98.  
  99. get_handle_attrib    ENDP
  100.  
  101. END
  102.